function runTimeTest() {
	var testcases = [
		"2pm", "1 AM", "24PM", "11:20am", "11:am", "dinner today 11:30am", "shower tomorrow 1:23pm",
		"Test 12:00", "Test 1:00", "Test:34:60", "Test 0:00", "Test 123:34", "test 22:0",
		"test next Monday", "test Thursday", "test thur", "run today", "hello tomorrow", "你好今天", "明天谁请我吃饭",
		"测试星期二", "下星期", "星期天", "下星期三", "周四吃饭阿", "下周五唱歌",
		"2008-01-01", "2009-1-1", "2008-1-21", "2008-12-2", "12-21"
	];
	
	var timeExes = [
		/([1-9]|1[0-2])(:[0-5][0-9])?(\s)?(a|p)m/i,
		/([0-9]|[0-1][0-9]|2[0-3]):([0-5][0-9])/i
	];
	
	var dateExes = [
		/(\d{4}-)?(\d{2}|\d{1})-(\d{2}|\d{1})/i,
		/(next )?(mon|tue|wed|thur|fri|sat|sun)/i,
		/today|tomorrow|今天|明天/i,
		/(下)?(星期|周)(一|二|三|四|五|六|七|天)/i
	];
	
	for (var i = 0; i < testcases.length; ++i) {
		var due = new Date(0);
		if (dateExes[0].test(testcases[i])) {
			// test on 2009-01-01
			var matches = dateExes[0].exec(testcases[i]);
			if (matches[1]) {
				due.setYear(parseInt(matches[1].substr(0, 4)));
			} else {
				due.setYear(new Date().getFullYear());
			}
			due.setMonth(parseInt(matches[2]) - 1);
			due.setDate(parseInt(matches[3]));
			due.setHours(23);
			due.setMinutes(59);
			due.setSeconds(59);
		} else if (dateExes[1].test(testcases[i])) {
			// test on days of week like monday or next monday and also support in Chinese
			var matches = dateExes[1].exec(testcases[i]);
			var dueday = 0;
			switch(matches[2].toLowerCase()) {
				case 'sun': dueday = 0; break;
				case 'mon': dueday = 1; break;
				case 'tue': dueday = 2; break;
				case 'wed': dueday = 3; break;
				case 'thur': dueday = 4; break;
				case 'fri': dueday = 5; break;
				case 'sat': dueday = 6; break;
			}
			if (matches[1]) {
				dueday += 7;
			}
			due = new Date();
			if (dueday < due.getDay()) {
				dueday += 7;
			}
			dueday -= due.getDay();
			due.setTime(due.getTime() + dueday * 24 * 60 * 60 * 1000);
			due.setHours(23);
			due.setMinutes(59);
			due.setSeconds(59);
		} else if (dateExes[2].test(testcases[i])) {
			// test on today
			var matches = dateExes[2].exec(testcases[i]);
			if (matches[0] == "today" || matches[0] == "今天") {
				due = new Date();
				due.setHours(23);
				due.setMinutes(59);
				due.setSeconds(59);
			} else {
				due = new Date();
				due.setDate(due.getDate() + 1);
				due.setHours(23);
				due.setMinutes(59);
				due.setSeconds(59);
			}
		} else if (dateExes[3].test(testcases[i])) {
			// test on days of week like monday or next monday and also support in Chinese
			var matches = dateExes[3].exec(testcases[i]);
			var dueday = 0;
			switch(matches[3]) {
				case '日': dueday = 0; break;
				case '天': dueday = 0; break;
				case '一': dueday = 1; break;
				case '二': dueday = 2; break;
				case '三': dueday = 3; break;
				case '四': dueday = 4; break;
				case '五': dueday = 5; break;
				case '六': dueday = 6; break;
			}
			if (matches[1]) {
				dueday += 7;
			}
			due = new Date();
			if (dueday < due.getDay()) {
				dueday += 7;
			}
			dueday -= due.getDay();
			due.setTime(due.getTime() + dueday * 24 * 60 * 60 * 1000);
			due.setHours(23);
			due.setMinutes(59);
			due.setSeconds(59);
		}
		
		if (timeExes[0].test(testcases[i])) {
			var matches = timeExes[0].exec(testcases[i]);
			if (due.getTime() == 0) {
				due = new Date();
			}
			if (matches[4].toLowerCase() === 'a') {
				due.setHours(parseInt(matches[1]));
			} else {
				due.setHours(parseInt(matches[1]) + 12);
			}
			if (matches[2]) {
				due.setMinutes(parseInt(matches[2].substr(1, 2)));
			} else {
				due.setMinutes(0);
			}
			due.setSeconds(0);
		} else 	if (timeExes[1].test(testcases[i])) {
			var matches = timeExes[1].exec(testcases[i]);
			if (due.getTime() === 0) {
				due = new Date();
			}
			due.setHours(parseInt(matches[1]));
			due.setMinutes(parseInt(matches[2]));
			due.setSeconds(0);
		}
		
		if (due.getTime() != 0) {
			var text = '<div class="task"><img src="res/Sticky.png" height="12"/><font color="green"> ' + testcases[i] + " due at " + due.toLocaleString() + "</font></div>";
			$(text).appendTo("#content");
		} else {
			var text = '<div class="task"><img src="res/Sticky.png" height="12"/> <font color="red">' + testcases[i] + " didn't pass the test. </font></div>";
			$(text).appendTo("#content");
		}
	}
}